home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Programming
/
LEDA
/
prog
/
dict
/
int_set.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-05
|
394b
|
37 lines
#include <LEDA/int_set.h>
#include <LEDA/list.h>
void print(const int_set& S , int a, int b)
{ for(int i=a;i<=b;i++)
if (S.member(i)) cout << i << " ";
newline;
}
main()
{
int a = read_int("a = ");
int b = read_int("b = ");
int_set S(a,b);
list<int> L;
L.read("L = ");
int i;
forall(i,L) S.insert(i);
print(S,a,b);
forall(i,L)
{ S.del(i);
print(S,a,b);
}
return 0;
}